home *** CD-ROM | disk | FTP | other *** search
/ Gamers Delight 2 / Gamers Delight 2.iso / Aminet / game / board / Spades.readme < prev    next >
Text File  |  1995-11-19  |  17KB  |  302 lines

  1. Short: a card game
  2. Type: game/think
  3. Uploader: sgberg@charon.bloomington.in.us (Stefan G. Berg)
  4. Author: stelmack@eggo.csee.usf.edu (Greg Stelmack)
  5.  
  6. Spades Version 2.12, by Greg Stelmack, April 2, 1992.
  7.  
  8. *** NOTE: Address change near bottom from version 1.2 documentation ***
  9. *** ALSO NOTE: System Software 2.xx is now REQUIRED to run Spades   ***
  10.  
  11.      "Spades" is a program written to play the card game Spades. It may be
  12. run from the CLI or the Workbench. The files required to play are "Spades"
  13. and "Spades.images", and both must be in the same directory. NOTE: Spades
  14. now requires AmigaDOS 2.xx to run. This is because Spades is essentially
  15. a tool for me to learn Amiga programming (I have made only $5 off of it),
  16. and I am trying out some of the 2.xx stuff as I modify it.
  17.      This is a one player version of Spades -- you play one hand, and the
  18. computer plays your partner and two opponents. The program plays by the
  19. following rules adopted by my friends and I here at the University of South
  20. Florida:
  21.      1) Four players are found, divided into two partnerships of two
  22. players each. Partners sit opposite each other.
  23.      2) A dealer is randomly picked. Each player receives 13 cards from a
  24. standard 52-card deck dealt clockwise starting with the player on the
  25. dealer's left. On successive hands, the deal passes to the left.
  26.      3) Starting to the left of the dealer, each player bids the number of
  27. tricks he feels his hand can take. Bidding passes clockwise. A
  28. partnership's bid is the total of the two partners' bids. A partnership
  29. must take this total number of tricks.
  30.      4) Play starts with the player to the left of the dealer and passes
  31. clockwise. The only rule about leading is that spades may not be lead until
  32. spades have been broken (i.e., played during a hand), unless a player holds
  33. only spades.
  34.      5) Players must follow suit -- if you have a card of the suit lead,
  35. you must play it. Otherwise, any suit may be played. Play ends with the
  36. player to the right of the leader. In other words, each player plays one
  37. card.
  38.      6) Highest card of the suit lead, or highest spade if a spade has been
  39. played, wins the trick. Cards rank 2 lowest through Ace highest. The trick
  40. winner scores one trick for his partnership and then leads for the next
  41. trick.
  42.      7) After all 13 tricks in a hand have been taken, scores are totaled.
  43. If a partnership takes at least as many tricks as they bid, they get 10
  44. points for each trick they bid and one point for each trick they took over
  45. their bid. If a partnership fails to take the number of tricks they bid,
  46. they lose 10 points for each trick they bid. If NIL bids are in effect, and
  47. a player bid zero tricks and took zero, his side scores 100 points. If a
  48. player bid zero and took at least one trick, his side loses 100 points. If
  49. Bags are in effect, and a team has accumulated 10 or more overtricks, they
  50. lose 100 points. Negative scores are possible.
  51.      8) Deal passes to the left for another hand. First team to 500, or the
  52. team with the highest score if both cross 500, wins.
  53.  
  54.      When the program is first started, the computer will randomly deal out
  55. cards to each player until the Ace of Spades is dealt. This player becomes
  56. the dealer. The computer will then deal the cards. You will see your hand
  57. at the bottom of the screen. Your partner sits across from you (at the top
  58. of the screen), and your opponents are to either side of you. The computer
  59. players will bid automatically. Their bids will appear as numbers in front
  60. of the positions at which they are sitting.
  61.      When it is your turn to bid, a black bid box will appear in the lower
  62. right-hand corner of the screen. Use the left mouse button to select your
  63. bid. Clicking on the plus sign will raise your bid one trick. Clicking on
  64. the minus sign will lower your bid one trick. Clicking on OK will accept
  65. your bid. Selecting the Suggest option from the Game menu (or typing Right-
  66. Amiga-s on the keyboard) will cause the computer to suggest a bid for you.
  67.      After all bids have been entered, the computer will pause for you to
  68. examine the bids. When you are ready to play, click the left mouse button.
  69.      Cards will then be played. Cards played by a computer player will
  70. appear in the appropriate position on the screen. When it is your turn to
  71. play, the computer will prompt you. Simply point at the card you want to
  72. play and click the left mouse button. Again, selecting Suggest from the
  73. Game menu will cause the computer to suggest a card for you to play (it
  74. will mark it with an asterisk).
  75.      Note that the computer will not let you play an illegal card. If
  76. nothing happens when you click, you are either trying to lead spades before
  77. they have been broken or you are not following the lead suit when you can.
  78.      After all cards in the trick have been played, the computer will place
  79. an asterisk in front of the winning card and update the trick count. If
  80. this was also the last trick in the hand, it will update the scores. It
  81. will then pause for you to look at all the cards that were played. When you
  82. are ready to continue, click the left mouse button.
  83.      This cycle will continue until a winner is found. The program will
  84. then display a final score screen and ask whether or not you would like to
  85. play again. Clicking YES will cause the game to start over. Clicking NO
  86. will bring you back to the environment you started the game from. Note that
  87. the game may be quit at any time by selecting Quit from the Project menu.
  88.  
  89.      There are now several menus with the game. Under the Project menu,
  90. there are New Game (start a new game), Save Hand (more in a minute),
  91. Print Hand (not yet implemented), About (shows some information about
  92. myself), and Quit (exit the game). Under the Game menu, there are NIL Bids
  93. (toggles the NIL rule on and off -- the rule is in effect when checked),
  94. Bags (toggles the Bags rule on and off -- the rule is in effect when
  95. checked), and Suggest (suggest a bid or play as listed above). New options
  96. may be added here later.
  97.      The Save Hand menu option is a toggle. As long as it is checked, each
  98. hand will be appended to the file "Spades.save" in the current directory.
  99. This option has been added for two reasons: so you can review hands later,
  100. and so that you can send me this file with a hand you think the computer
  101. goofed up on. If you see a mistake, turn this option on, and then mail or
  102. E-Mail me a copy of that file, along with the play you feel the computer
  103. should have made and why. I will use this to help enhance the computer
  104. players. NOTE: If you leave this option on, the Spades.save file can get
  105. quite large. Remember to clean it up from time to time. Spades creates this
  106. file if it doesn't exist, so don't worry about keeping a copy around.
  107.  
  108. For Programmers:
  109.      The source code should be included with the program. The game is
  110. written in C and compiled using SAS/C 5.10b. I hope that anyone out there
  111. interested in designing their own card games will find this code useful.
  112. Note that the "Spades.images" file contains all the data necessary to draw
  113. the cards. The reader routine is in the procedure "OpenAll". Feel free to
  114. use any or all of the code or images in your own programs. The current
  115. version was compiled with the following command for each source file:
  116.      LC -ma -rr -O -cf -cs -E -Li -q10e -q10w -ms -N SourceFile.c
  117. and then all were linked together into the Spades executable (Well,
  118. actually I now use the Workbench interface, but this is the equivalent
  119. command line for the options I used...)
  120.      The program (as of version 2.10) has been broken up into several
  121. source files. Since I use the Workbench interface for SAS/C, I do not have
  122. a Makefile for it, but I have included the SASCOPTS file that I use for
  123. compiling.
  124.  
  125. Copyright Notice:
  126.      This program is copyright 1990 by Gregory M. Stelmack. However, I give
  127. permission for anyone to freely distribute this program as long as this
  128. file and the by-line in the title bar of the game remains, and they make no
  129. profit from its distribution (cost of media may be charged -- this is an
  130. implicit OK for Fred Fish to put Spades in his collection). Also, you may
  131. use any of the code for your own programs, but please remember to give
  132. credit where credit is due. I cannot be held responsible for damage that
  133. occurs as a result of the use/misuse of this program, but note that I have
  134. made every effort to make sure it will work properly.
  135.      If you find problems, useful enhancements, new rules I may want to
  136. include, or if you would like to send a donation (say 5 or 10 dollars) to
  137. cover my costs (computer, compiler, tools, education, etc.), my address is:
  138.                    Gregory M. Stelmack
  139.                    8723 Del Rey Ct. #11-A
  140.                    Tampa, FL 33617
  141. Feel free to send any comments or suggestions to the above address.
  142. E-mail to: stelmack@eggo.csee.usf.edu
  143. BBS: Simply Amazing! (813)977-3940 in Tampa: GREG STELMACK
  144.  
  145. VERSION CHANGES:
  146.  
  147. Changes 1.0 to 1.1:
  148.      Removed need for Spades.font. Card data is now stored in
  149. Spades.images, and this file is read in at run-time.
  150.      Added title graphics.
  151.      Added routine for choosing dealer.
  152.      First release version.
  153.  
  154. Changes 1.1 to 1.11:
  155.      Corrected a memory allocation and fragmentation bug. The program was
  156. only freeing a portion of its allocated memory. It now frees all of it.
  157. Thanks to Juan Orlandini for catching this.
  158.      Added a few prompts for mouse clicks where the program used to just
  159. pause.
  160.  
  161. Changes 1.11 to 1.12:
  162.      Changed the LIBRARY_VERSION in the OpenLibrary() calls to zero. This
  163. is an attempt to let the program run under pre-1.3 Workbench, but I make no
  164. guarantees.
  165.  
  166. Changes 1.12 to 1.20:
  167.      Some of the strategy and bidding routines have been slightly modified.
  168. Hopefully the computer plays a little better now, but there is room for a
  169. little more improvement. Maybe I'll have some time this Summer...
  170.      Added a HIDE gadget in the Window TitleBar. Allows Spades to move to
  171. the background so you can do something else if you get bored :).
  172.  
  173. Changes 1.20 to 2.00:
  174.      New images! Now the face cards and aces look like real face cards and
  175. aces :).
  176.      New user-interface. Menus have been added to support the optional
  177. rules (see below). Errors now bring up requestors, which allowed the
  178. removal of stdio. Unfortunately, I use EasyRequest() from V36 of the
  179. Intuition library, so you now need AmigaDOS 2.xx to use Spades :(. Window
  180. is now a backdrop window, and the screen's titlebar is visible, meaning
  181. the screen may be shoved to the back or dragged like any other Intuition
  182. screen.
  183.      The rules for NIL bids and Bags have been added. Brief explanation:
  184. bids allow you to bid zero, and if you take no tricks gain 100 points. If
  185. you take at least one trick, you lose 100 points. Bags refer to overtricks --
  186. if your team accumulates 10 overtricks over a series of hands, you lose 100
  187. points. Unfortunately, the computer players do not yet know about these
  188. new rules. They are, however, optional, so they may be turned on and off at
  189. will (the default is OFF).
  190.      Removed the title graphics (no real added value, and the executable is
  191. now MUCH smaller).
  192.  
  193. Changes 2.00 to 2.10:
  194.      Broke the source code up into several files to make room for future
  195. enhancements. Implemented the Save Hand menu option. More extensive use
  196. of System 2.0 features, including use of GadTools for Menu creation and
  197. layout. Improved the computer players to now take the optional rules into
  198. account.
  199.  
  200. Changes 2.10 to 2.11:
  201.      I stupidly called EasyRequest() to display every error message,
  202. including the one when Intuition can't be opened! I can't come up with a
  203. good way of doing this short of going back to standard I/O, or including
  204. lots of code for this one case, so for right now the program will just
  205. quietly closed if Intuition cannot be opened. This generally happens when
  206. Spades is run under 1.3, which it no longer will.
  207.  
  208. Changes 2.11 to 2.12:
  209.      If a game was started by selecting "New Game" from the menu, it was
  210. impossible to exit the game from the final screen. Selecting the "NO"
  211. button would just restart Spades. I still don't know why this happened
  212. (tracing seemed to show a random jump into my ReadMouse() routine), but
  213. I redid the logic (FinishRoutine() now directly calls WrapUp(), and the
  214. AllDone flag has been eliminated) and it works properly now.
  215.  
  216. FUTURE ENHANCEMENTS PLANNED (time permitting, of course):
  217.      Strategy: Computer still occasionally does something dumb, mostly
  218. because it has difficulty looking into the future and predicting who is out
  219. of what. I need to make it smarter. Also, it bids poorly (too low) with
  220. lots of Spades in its hand.
  221.      Options: Implement the Print Hand option (although you could just
  222. print the Spades.save file.
  223.      1.3 version: If enough people ask for it...
  224.  
  225.  
  226. ============================= Archive contents =============================
  227.  
  228. Original  Packed Ratio    Date     Time    Name
  229. -------- ------- ----- --------- --------  -------------
  230.      900     344 61.7% 21-Jul-92 12:32:24  Spades.info
  231.       37      37  0.0% 09-Dec-91 20:55:04  Spades/.info
  232.      722     297 58.8% 03-Feb-92 21:21:38  Spades/IFF/2c.iff
  233.      800     292 63.5% 03-Feb-92 21:21:38  Spades/IFF/2d.iff
  234.      788     308 60.9% 03-Feb-92 21:21:38  Spades/IFF/2h.iff
  235.      730     305 58.2% 03-Feb-92 21:21:38  Spades/IFF/2s.iff
  236.      750     321 57.2% 03-Feb-92 21:21:38  Spades/IFF/3c.iff
  237.      850     309 63.6% 03-Feb-92 21:21:38  Spades/IFF/3d.iff
  238.      834     323 61.2% 03-Feb-92 21:21:38  Spades/IFF/3h.iff
  239.      758     341 55.0% 03-Feb-92 21:21:40  Spades/IFF/3s.iff
  240.      714     314 56.0% 03-Feb-92 21:21:40  Spades/IFF/4c.iff
  241.      800     315 60.6% 03-Feb-92 21:21:40  Spades/IFF/4d.iff
  242.      788     339 56.9% 03-Feb-92 21:21:40  Spades/IFF/4h.iff
  243.      716     330 53.9% 03-Feb-92 21:21:40  Spades/IFF/4s.iff
  244.      736     334 54.6% 03-Feb-92 21:21:40  Spades/IFF/5c.iff
  245.      842     330 60.8% 03-Feb-92 21:21:40  Spades/IFF/5d.iff
  246.      824     361 56.1% 03-Feb-92 21:21:40  Spades/IFF/5h.iff
  247.      744     358 51.8% 03-Feb-92 21:21:40  Spades/IFF/5s.iff
  248.      730     334 54.2% 03-Feb-92 21:21:42  Spades/IFF/6c.iff
  249.      852     317 62.7% 03-Feb-92 21:21:42  Spades/IFF/6d.iff
  250.      834     353 57.6% 03-Feb-92 21:21:42  Spades/IFF/6h.iff
  251.      732     353 51.7% 03-Feb-92 21:21:42  Spades/IFF/6s.iff
  252.      740     356 51.8% 03-Feb-92 21:21:42  Spades/IFF/7c.iff
  253.      872     346 60.3% 03-Feb-92 21:21:42  Spades/IFF/7d.iff
  254.      858     384 55.2% 03-Feb-92 21:21:42  Spades/IFF/7h.iff
  255.      744     386 48.1% 03-Feb-92 21:21:44  Spades/IFF/7s.iff
  256.      744     356 52.1% 03-Feb-92 21:21:44  Spades/IFF/8c.iff
  257.      880     334 62.0% 03-Feb-92 21:21:44  Spades/IFF/8d.iff
  258.      872     367 57.9% 03-Feb-92 21:21:44  Spades/IFF/8h.iff
  259.      744     377 49.3% 03-Feb-92 21:21:44  Spades/IFF/8s.iff
  260.      744     365 50.9% 03-Feb-92 21:21:44  Spades/IFF/9c.iff
  261.      882     366 58.5% 03-Feb-92 21:21:44  Spades/IFF/9d.iff
  262.      874     371 57.5% 03-Feb-92 21:21:44  Spades/IFF/9h.iff
  263.      746     400 46.3% 03-Feb-92 21:21:44  Spades/IFF/9s.iff
  264.      956     343 64.1% 03-Feb-92 21:21:46  Spades/IFF/ac.iff
  265.      956     335 64.9% 03-Feb-92 21:21:46  Spades/IFF/ad.iff
  266.      956     348 63.5% 03-Feb-92 21:21:46  Spades/IFF/ah.iff
  267.      956     346 63.8% 03-Feb-92 21:21:46  Spades/IFF/as.iff
  268.      956     567 40.6% 03-Feb-92 21:21:46  Spades/IFF/jc.iff
  269.      956     574 39.9% 03-Feb-92 21:21:46  Spades/IFF/jd.iff
  270.      956     593 37.9% 03-Feb-92 21:21:46  Spades/IFF/jh.iff
  271.      956     586 38.7% 03-Feb-92 21:21:46  Spades/IFF/js.iff
  272.      956     539 43.6% 03-Feb-92 21:21:48  Spades/IFF/kc.iff
  273.      956     562 41.2% 03-Feb-92 21:21:48  Spades/IFF/kd.iff
  274.      956     569 40.4% 03-Feb-92 21:21:48  Spades/IFF/kh.iff
  275.      956     565 40.8% 03-Feb-92 21:21:48  Spades/IFF/ks.iff
  276.      956     577 39.6% 03-Feb-92 21:21:48  Spades/IFF/qc.iff
  277.      956     584 38.9% 03-Feb-92 21:21:48  Spades/IFF/qd.iff
  278.      956     592 38.0% 03-Feb-92 21:21:48  Spades/IFF/qh.iff
  279.      956     585 38.8% 03-Feb-92 21:21:50  Spades/IFF/qs.iff
  280.      744     382 48.6% 03-Feb-92 21:21:50  Spades/IFF/tc.iff
  281.      882     390 55.7% 03-Feb-92 21:21:50  Spades/IFF/td.iff
  282.      874     411 52.9% 03-Feb-92 21:21:50  Spades/IFF/th.iff
  283.      748     422 43.5% 03-Feb-92 21:21:50  Spades/IFF/ts.iff
  284.     4258    1387 67.4% 01-Feb-92 10:13:34  Spades/Source/Bidding.c
  285.     7028    1397 80.1% 02-Feb-92 22:11:30  Spades/Source/Files.c
  286.     4103    1361 66.8% 02-Feb-92 22:09:34  Spades/Source/Globals.h
  287.     4600    1014 77.9% 30-Jan-92 21:43:14  Spades/Source/Graphics.c
  288.     1539     534 65.3% 02-Apr-92 21:59:24  Spades/Source/Graphics.h
  289.     1263     521 58.7% 02-Apr-92 21:01:54  Spades/Source/Include.h
  290.    12232    3271 73.2% 02-Apr-92 21:29:56  Spades/Source/Input.c
  291.    16737    3905 76.6% 03-Feb-92 18:22:28  Spades/Source/Play.c
  292.       54      54  0.0% 02-Apr-92 21:32:06  Spades/Source/SASCOPTS
  293.    14538    4310 70.3% 02-Apr-92 21:31:26  Spades/Source/Spades.c
  294.      993     402 59.5% 02-Feb-92 20:50:54  Spades/Source/Spades.proto
  295.    16844    8811 47.6% 02-Apr-92 22:02:10  Spades/Spades
  296.    39312   10050 74.4% 03-Feb-92 21:20:08  Spades/Spades.images
  297.     1306     225 82.7% 07-Apr-91 11:37:22  Spades/Spades.info
  298.    12618    5401 57.1% 02-Apr-92 22:10:02  Spades/Spades.readme
  299.      849     331 61.0% 17-Mar-92 13:43:24  Spades/Spades.readme.info
  300. -------- ------- ----- --------- --------
  301.   182999   64167 64.9% 09-Dec-92 07:00:00   70 files
  302.